package com.gxa.modules.deviceManager.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gxa.modules.deviceManager.form.MaintenanceRecordForm;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

@Data
@NoArgsConstructor
@TableName("y_maintenance_record")
public class MaintenanceRecord implements Serializable {

    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    @TableField("equipment_name")
    private String equipmentName;
    @TableField("equipment_number")
    private String equipmentNumber;
    @TableField("brand_model")
    private String brandModel;
    private String area;
    @TableField("maintenance_personnel")
    private String maintenancePersonnel;
    @TableField("fault_description")
    private String faultDescription;
    private String result;
    @TableField("add_time")
    private Date addTime;
    private String note;
    @TableField("community_id")
    private Integer communityId;

    public MaintenanceRecord(MaintenanceRecordForm maintenanceRecordForm) {
        this.id = maintenanceRecordForm.getId();
        this.equipmentName = maintenanceRecordForm.getEquipmentName();
        this.equipmentNumber = maintenanceRecordForm.getEquipmentNumber();
        this.brandModel = maintenanceRecordForm.getBrandModel();
        this.area = maintenanceRecordForm.getArea();
        this.maintenancePersonnel = maintenanceRecordForm.getMaintenancePersonnel();
        this.faultDescription = maintenanceRecordForm.getFaultDescription();
        this.result = maintenanceRecordForm.getResult();
        this.addTime = maintenanceRecordForm.getAddTime();
        this.note = maintenanceRecordForm.getNote();
        this.communityId = maintenanceRecordForm.getCommunityId();
    }
}
